package com.mf.framework.component.excel;

/**
 * 正常列
 * User: zhaoming
 * Date: 2017-03-16
 * To change this template use File | Settings | File Templates.
 **/
public class NormalColumn {

    /**
     * 默认列宽
     */
    private final Integer DEFAULT_COLUMN_WIDTH = 20 * 256;
    /**
     * 列名
     */
    private String columnName;
    /**
     * 映射到实体的属性名
     */
    private String columnCode;
    /**
     * 列宽
     */
    private Integer columnWidth;

    /**
     * 构造函数
     * @param columnName 列名
     */
    public NormalColumn(String columnName){
        this.columnName = columnName;
        this.columnWidth = DEFAULT_COLUMN_WIDTH;
    }

    /**
     * 构造函数
     * @param columnName 列名
     * @param columnWidth 列宽
     */
    public NormalColumn(String columnName, Integer columnWidth){
        this.columnName = columnName;
        this.columnWidth = columnWidth >= DEFAULT_COLUMN_WIDTH ? columnWidth : DEFAULT_COLUMN_WIDTH;
    }

    /**
     * 构造函数
     * @param columnName 列名
     * @param columnCode 映射到实体的属性名
     */
    public NormalColumn(String columnName, String columnCode){
        this.columnName = columnName;
        this.columnCode = columnCode;
        this.columnWidth = DEFAULT_COLUMN_WIDTH;
    }

    /**
     * 构造函数
     * @param columnName 列名
     * @param columnCode 映射到实体的属性名
     * @param columnWidth 列宽
     */
    public NormalColumn(String columnName, String columnCode, Integer columnWidth){
        this.columnName = columnName;
        this.columnCode = columnCode;
        this.columnWidth = columnWidth >= DEFAULT_COLUMN_WIDTH ? columnWidth : DEFAULT_COLUMN_WIDTH;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getColumnCode() {
        return columnCode;
    }

    public void setColumnCode(String columnCode) {
        this.columnCode = columnCode;
    }

    public Integer getColumnWidth() {
        return columnWidth;
    }

    public void setColumnWidth(Integer columnWidth) {
        this.columnWidth = columnWidth;
    }
}
